--
-- Project: Parallaxing BG Test
-- Description: 
--
-- Version: 1.0
-- Managed with http://CoronaProjectManager.com
--
-- Copyright 2012 . All Rights Reserved.
-- 
ParallaxingBG = {}local _spdfunction ParallaxingBG:new(imgPath, spd)		local imgGroup = display.newGroup()	local bg1 = display.newImage(imgPath)	local bg2 = display.newImage(imgPath)				if spd < 0 then		bg2.x = bg1.width * (1.5)	else		bg2.x = -bg1.width * (.5)	end		imgGroup:insert(bg1)	imgGroup:insert(bg2)		function imgGroup:update()			for i = 1, imgGroup.numChildren, 1 do			imgGroup[i].x = imgGroup[i].x + (spd)			if spd < 0 then										if imgGroup[i].x + (imgGroup[i].width / 2) <= 0 then					imgGroup[i].x = imgGroup[i].width + (imgGroup[i].width / 2)				end			else				if imgGroup[i].x - (imgGroup[i].width / 2)  >= 960 then					imgGroup[i].x = -imgGroup[i].width + (imgGroup[i].width / 2)				end			end		end	end	return imgGroupendreturn ParallaxingBG